package vista;

import java.awt.BorderLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

@SuppressWarnings("serial")
public class VistaCadastro extends JPanel {
	
	JPanel painel;
	JPanel central;
	JLabel id;
	JLabel senha;
	JLabel tituloJanela;
	JTextField campoId;
	JTextField campoSenha;
	JButton botao;
	
	public VistaCadastro(){
		super(new BorderLayout());
		painel = new JPanel(new GridBagLayout());
		central = new JPanel();
		id = new JLabel("Nome");
		senha = new JLabel("num");
		campoId = new JTextField();
		campoSenha = new JTextField();
		botao = new JButton("Cadastrar");
		tituloJanela = new JLabel("Cadastro");
		GridBagConstraints cons = new GridBagConstraints();
		cons.fill = GridBagConstraints.BOTH;
		cons.weightx = 1;
		cons.gridwidth = GridBagConstraints.REMAINDER;
		
		painel.add(id, cons);
		painel.add(campoId, cons);
		painel.add(senha, cons);
		painel.add(campoSenha, cons);
		add(painel, BorderLayout.CENTER);
		central.add(botao);
		add(central, BorderLayout.SOUTH);
		add(tituloJanela, BorderLayout.NORTH);
		
		setVisible(true);
	}

	public JLabel getSenha() {
		return senha;
	}

	public JLabel getTituloJanela() {
		return tituloJanela;
	}

	public JButton getBotao() {
		return botao;
	}

	public JTextField getCampoId() {
		return campoId;
	}

	public JTextField getCampoSenha() {
		return campoSenha;
	}
	
	public void zerarCampos(){
		campoId.setText("");
		campoSenha.setText("");
	}
}
